package com.oo.polymorphic_4.pizza;

import java.util.Scanner;

/**
 * BaconPizza--${description}
 *
 * @author: Jovi
 * @createTime: 2017-05-09 17:20
 **/
public class BaconPizza extends Pizza {
    private int weight;

    public BaconPizza(String name, double price, int size, int weight) {
        super(name, price, size);
        this.weight = weight;
    }

    public BaconPizza() {
        System.out.println("请输入培根克数：");
        Scanner sc = new Scanner(System.in);
        this.weight =sc.nextInt();
    }

    @Override
    public void make() {
        System.out.println("名称：" + this.getName()
                + "\n价格：" + this.getPrice() + "元\n大小："
                + this.getSize() + "寸\n培根克数："
                + this.getWeight());
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }
}
